﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Shop.Model.Custom;
using Shop.Framework.Keys;
using Shop.Model;

namespace Shop.Framework.Control {
    public class PagingControl:ViewUserControl {

        public Category CurrentCategory { get; set; }
        public Designer CurrentDesigner { get; set; }
        public bool IsCategory { get; set; }
        public bool IsDesigner { get; set; }

        public PagingModel PagingModel { get; set; }
        protected override void OnInit(EventArgs e) {
            try {
                
                CurrentCategory = ViewData[ShopKey.CurrentCategory] as Category;
                CurrentDesigner = ViewData[ShopKey.CurrentDesigner] as Designer;

                IsCategory = CurrentCategory != null;
                IsDesigner = CurrentDesigner != null;                
                PagingModel = Session[SessionKey.PagingModel] as PagingModel;
                base.OnInit(e);
            } catch (Exception ex) {
                throw ex;
            }
        }
        
    }
}
